Web page presentation - Plot created with Plotly

Leena Sonpethkar

January 31, 2021

R Markdown Presentation & Plotly

Instructions

Review criteria

The rubric contains the following two questions:

Submission

library(ggplot2)
library(tidyr)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
data(diamonds)

dfDiamond <- diamonds %>%
              group_by(cut, color) %>%
              summarise(price = sum(price))

pl <- plot_ly(dfDiamond, x = ~color, y = ~price, color = ~cut, type="bar") %>% 
      layout(title = "Diamond price based on Cut by Colors", xaxis=list(title="Cut"), yaxis=list(title="Price"))

pl

Thanks